package tron

import (
	"context"
	"tronServer/internal/model/domain"
	"tronServer/utility/tron"

	"tronServer/api/tron/v1"
)

// TronUsdtTradeQuery Usdt 交易查询
func (c *ControllerV1) TronUsdtTradeQuery(ctx context.Context, req *v1.TronUsdtTradeQueryReq) (res *v1.TronUsdtTradeQueryRes, err error) {
	var (
		detail *domain.UsdtTransactionDetails
	)
	// 查询Usdt交易详情
	{
		if detail, err = tron.Query.GetUsdtTransactionDetailsTxId(ctx, req.TxId); err != nil {
			return
		}
	}
	// 组装数据
	{
		res = &v1.TronUsdtTradeQueryRes{
			UsdtTransactionDetails: detail,
		}
	}
	return
}
